package me.hunche.app.domain;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.feinno.framework.common.domain.AbstractEntity;



@Entity
@Table(name="t_car")
public class Car extends AbstractEntity  implements Serializable{

	private static final long serialVersionUID = 2710368464946203094L;
	
	@Id 
    @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	private String licenseNo;
	private Long ownerId;
	
//	@OneToOne
//	@JoinColumn(name = "owner_id", referencedColumnName = "owner_id")
	@Transient transient private User owner;

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getLicenseNo() {
		return licenseNo;
	}
	public void setLicenseNo(String licenseNo) {
		this.licenseNo = licenseNo;
	}
	
	public User getOwner() {
		return owner;
	}
	public void setOwner(User owner) {
		this.owner = owner;
	}
	public Long getOwnerId() {
		return ownerId;
	}
	public void setOwnerId(Long ownerId) {
		this.ownerId = ownerId;
	}
	@Override
	public String toString() {
		return "Car [id=" + id + ", licenseNo=" + licenseNo + ", ownerId="
				+ ownerId + "]";
	}
	
	
}
